function SaveImgAnalysis(type_img,handles,rawimages,yInt,xInt,ODraw)

% Save desired information to HDF file:
if type_img == 3  %Absorption
    SaveAnalysisHDF(handles.dpath,'numAtomsXfit1d',handles.numatoms.xfit1d);
    SaveAnalysisHDF(handles.dpath,'numAtomsYfit1d',handles.numatoms.yfit1d);
    SaveAnalysisHDF(handles.dpath,'totalOD',handles.OD.intODanaly);
    SaveAnalysisHDF(handles.dpath,'totalElec1',sum(sum(rawimages(:,:,1))));
    SaveAnalysisHDF(handles.dpath,'totalElec2',sum(sum(rawimages(:,:,2))));
    SaveAnalysisHDF(handles.dpath,'totalElec3',sum(sum(rawimages(:,:,3))));
    SaveAnalysisHDF(handles.dpath,'peakODImage',handles.OD.peakimage);
    
elseif type_img == 1  %Fluorescence
    SaveAnalysisHDF(handles.dpath,'numAtoms',handles.numatoms.ODint);
    SaveAnalysisHDF(handles.dpath,'totalOD',0);
end
SaveAnalysisHDF(handles.dpath,'numAtomsFit',handles.numatoms.fit2d);
SaveAnalysisHDF(handles.dpath,'xFitParam1d',handles.fitparam.xfit1d);
SaveAnalysisHDF(handles.dpath,'yFitParam1d',handles.fitparam.yfit1d);
SaveAnalysisHDF(handles.dpath,'FitParam2d',handles.fitparam.fit2d);
SaveAnalysisHDF(handles.dpath,'yData',yInt);
SaveAnalysisHDF(handles.dpath,'xData',xInt);
if handles.saveOD % Whether to save processed image or not (costly in terms of space)
    SaveAnalysisHDF(handles.dpath,'OD',ODraw);
end
end